<template>
  <div class="detail-list">
    <div class="detail-item border-bottom" v-for="(item, index) of list" :key="index">
      <div class="item-title">
        <span class="detail-item-icon"></span>
        {{item.title}}
      </div>
      <div class="item-children" v-if="item.children && item.children.length">
        <detail-list :list="item.children"></detail-list>
      </div>
    </div>
  </div>
</template>

<script>
export default{
  name: 'DetailList',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  .border-bottom
    &:before
      border-color: #cccccc
  .item-title
    line-height: .8rem
    padding-left: 0 .2rem
    font-size: .32rem
    .detail-item-icon
      display: inline-block
      position: relative
      width: 0.36rem
      height: 0.36rem
      top: 0.08rem
      left: 0.1rem
      background: url(//s.qunarzz.com/piao/image/touch/sight/detail.png) 0 -0.45rem no-repeat
      margin-right: 0.1rem
      background-size: 0.4rem 3rem
  .item-children
    padding: 0 .2rem
</style>
